package models

 type TbUser  struct {
    
        Id int `gorm:"column:id;auto_increment" json:"id"`
	
        Name string `gorm:"column:name;" json:"name"`
	
        UserName string `gorm:"column:user_name;" json:"user_name"`
	
        X bool `gorm:"column:x;" json:"x"`
	
 }
 
  func(this *TbUser) WithId(id int) *TbUser  {
      this.Id=id
      return this
  }
  
  func(this *TbUser) WithName(name string) *TbUser  {
      this.Name=name
      return this
  }
  
  func(this *TbUser) WithUserName(user_name string) *TbUser  {
      this.UserName=user_name
      return this
  }
  
  func(this *TbUser) WithX(x bool) *TbUser  {
      this.X=x
      return this
  }
  

  
   type TbUserOptions struct {
       apply func(*TbUser)
   }
   func NewTbUser(opts...*TbUserOptions)  *TbUser {
       m:= &TbUser{}
       for _,opt:=range opts{
           opt.apply(m)
       }
       return m
   }
    
   func TbUserId(id int) *TbUserOptions {
       return &TbUserOptions{func(model *TbUser) {
           model.Id=id
       }}
   }
   
   func TbUserName(name string) *TbUserOptions {
       return &TbUserOptions{func(model *TbUser) {
           model.Name=name
       }}
   }
   
   func TbUserUserName(user_name string) *TbUserOptions {
       return &TbUserOptions{func(model *TbUser) {
           model.UserName=user_name
       }}
   }
   
   func TbUserX(x bool) *TbUserOptions {
       return &TbUserOptions{func(model *TbUser) {
           model.X=x
       }}
   }
   









